<template>
  <div>
    <div>
        <to-search class="box"></to-search>
        <input type="text" placeholder="请输入关键字">
<br>
        <button>综合排序</button>
        <button>销量</button>
        <button>价格</button>
        <button>好评度</button> 
        <!-- <v-button>店铺</v-button>
        <v-button>筛选</v-button> -->
    </div>
    <!-- 3.遍历数据  -->
    <!-- <h2 v-if="arr.length==0">暂无数据~~去逛逛</h2>
    <router-link class="lie"
      :to="{ name: '商品详情', params: { id: item.id } }"
      v-for="item in arr"
      :key="item.id">
      <img :src="$pre + item.img" alt="" />
      <div>name:{{ item.goodsname }}</div>
      <div>price:{{ item.price | filterPrice }}</div>
    </router-link> -->
    <van-card
      @click="$router.push({ name: '商品详情', params: { id: item.id } })"
      v-for="item in arr"
      :key="item.id"
      :price="item.price"
      :title="item.goodsname"
      :thumb="$pre + item.img"
    />
 
    <!-- 暂无数据  -->
    <van-empty v-if="arr.length == 0" description="暂无数据" />
  </div>
</template>

<script>
import {reqlist} from "../../http/http"
export default {
 
    data() {
        return {
            arr:[]
        };
    },
    created() {

    },
    mounted() {
        reqlist({
            cateid:this.$route.query.id,
            type:1
        }).then((res)=>{
            this.arr=res.data.list.goodData?res.data.list.goodData:[]
        })
    },
    methods: {

    }
};
</script>

<style scoped>
.lie{
    display: flex;
}
img{
    width: 100px;
    height: 100px;
}
</style>
